//
//  MyLookTableViewCell.m
//  QXShowing
//
//  Created by 王道道 on 2018/7/21.
//  Copyright © 2018年 doll_dream. All rights reserved.
//

#import "MyLookTableViewCell.h"

@implementation MyLookTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self initView];
    }
    return self;
}

- (void)initView {
    //展会
    self.nameLabel = [[UILabel alloc]init];
    self.nameLabel.textColor = Text_Color_000000;
    self.nameLabel.text = @"杭州西博春季博览会";
    self.nameLabel.font = BHFont_Size_15;
    [self.contentView addSubview:self.nameLabel];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(15);
        make.left.equalTo(self.contentView).offset(15);
        make.right.equalTo(self.contentView).offset(-15);
    }];
    
    //展区
    self.areaLabel = [[UILabel alloc]init];
    self.areaLabel.textColor = Text_Color_000000;
    self.areaLabel.text = @"杭州西博春季博览会";
    self.areaLabel.font = BHFont_Size_15;
    [self.contentView addSubview:self.areaLabel];
    [self.areaLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.nameLabel.mas_bottom).offset(10);
        make.left.equalTo(self.nameLabel);
        make.right.equalTo(self.nameLabel);
    }];
    
    //公司
    self.companyLabel = [[UILabel alloc]init];
    self.companyLabel.textColor = Text_Color_000000;
    self.companyLabel.text = @"杭州西博春季博览会";
    self.companyLabel.font = BHFont_Size_15;
    [self.contentView addSubview:self.companyLabel];
    [self.companyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.areaLabel.mas_bottom).offset(10);
        make.left.equalTo(self.nameLabel);
        make.right.equalTo(self.nameLabel);
        make.bottom.equalTo(self.contentView).offset(-15);
    }];
}

- (void)setModel:(MyLookModel *)model {
    if (![BHSettingUtil dataAndStringIsNull:model]) {
        _model = model;
        NSString *nameStr = [NSString stringWithFormat:@"展会：%@", [BHSettingUtil dataAndStringIsNull:model.exhibition_name]?@"未知":model.exhibition_name];
        NSString *areaStr = [NSString stringWithFormat:@"展区：(%@区)", [BHSettingUtil dataAndStringIsNull:model.area_name]?@"未知":model.area_name];
        NSString *companyStr = [NSString stringWithFormat:@"公司：%@", [BHSettingUtil dataAndStringIsNull:model.company_name]?@"未知":model.company_name];
        self.nameLabel.text = nameStr;
        self.areaLabel.text = areaStr;
        self.companyLabel.text = companyStr;
    }
}

@end
